const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  entry: './src/index.js',
  output: {
    filename:'bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  devtool: 'source-map', // 可以产生source-map
  resolve: { // 更改解析模块的查找方式,这样子的意思就是先查找source
    modules: [path.resolve(__dirname, 'source'),path.resolve(__dirname, 'node_modules') ]
  },
  plugins:[
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, 'public/index.html')
    })
  ]
}